package org.mtmi.tuio.listeners;

import org.eclipse.swt.graphics.Point;
import org.mtmi.ui.scenes.Scene;
import org.mtmi.ui.scenes.SceneManager;

/**
 * Instances of this class are sent whenever drag gestures occur. 
 * See {@link DragListener#drag(LocatedEvent)}
 * @author jgout
 *
 */
public class LocatedEvent {

	/** 0..1 scene location */
	public final float x;
	/** 0..1 scene location */
	public final float y;
	
	/** scene location in pixels */
	public final int ex;
	/** scene location in pixels */
	public final int ey;
	
	public LocatedEvent( float f, float g ) {
		this.x = f;
		this.y = g;
		Scene scene = SceneManager.getDefault().getScene();
		Point p = scene.getEventPosition( f, g );
		ex = p.x;
		ey = p.y;
	}
	
	public LocatedEvent( float f, float g, int x, int y ) {
		this.x = f;
		this.y = g;
		ex = x;
		ey = y;
	}
}
